package com.lzm.springcloud.Controller;

import com.lzm.springcloud.pojo.Dept;
import com.lzm.springcloud.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @Description: TODO
 * @author: lzm
 * @date: 2021年04月22日 18:18
 */
@RestController
public class DeptConsumerController {

    @Autowired
    private DeptClientService deptClientService=null;


    @RequestMapping("/consumer/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id)
    {
        return this.deptClientService.queryById(id);
    }

    @RequestMapping("/consumer/dept/add")
    public boolean add(Dept dept)
    {
        return this.deptClientService.addDept();
    }

    @RequestMapping("/consumer/dept/list")
    public List<Dept> list()
    {
        return this.deptClientService.queryAll();
    }
}
